﻿var rowcmd = function (cmd, record) {
    switch (cmd) {
        case "edit":
            var wnd = EditBadgeWnd;
            wnd.autoLoad.params.bid = record.id;
            wnd.show();
            break;
        case "delete":
            Ext.Msg.confirm('提示', '确定要删除该记录吗?', function (btn) {
                if (btn == "yes") {
                    Ext.Ajax.request({
                        url: "/BgMgr/BadgeConfig/RemoveBadge",
                        params: {
                            bid: record.id
                        },
                        success: function (resp, opts) {
                            GridPanel1.store.reload();
                        },
                        failure: function (resp, opts) {
                            var json = Ext.util.JSON.decode(resp.responseText);
                            Ext.Msg.show({
                                title: '错误信息',
                                msg: json.extraParams.msg,
                                buttons: Ext.Msg.OK,
                                icon: Ext.Msg.ERROR
                            });
                        },
                        disableCaching: true
                    });
                }
            });
            break;
    }
};